package gov.dhs.cis.soa.data;

import gov.dhs.cis.soa.Constants;
import gov.dhs.cis.soa.Utils;
import gov.dhs.cis.soa.Constants.EntityType;

import java.sql.Timestamp;


public class SecurityComp extends AbstractSOAData {
	public static final String STEREO_TYPE = "Security Capability";

	public static final String INT_TYPE = "Integrated";
	public static final String SUP_TYPE = "Supported";
	public static final String USED_TYPE = "Used";
	
	public int id;
	public String name;
	public String procInput;
	public String procOutput;
	public String layer;
	public String release;
	public transient String impl;
		
	public transient Timestamp createdDt = new Timestamp(System.currentTimeMillis());
	public Description desc;

	@Override
	public String toString() {
		String ret = "SecurityComp [id=" + id + ", name=" + name + ", Desc = " + desc + "] ";
		return ret;
	}
	
	public void createDescription() {
		StringBuffer txt = new StringBuffer();
		if(Utils.isEmpty(impl))
			impl = "";
		txt.append(Constants.NL+"Design Aspects = " + impl);
		
		desc = Utils.prepareDescObj(txt.toString(), EntityType.SECCP);
	}

//	public static String getUMLId(int entityId) {
//		return EntityType.SECCP + "_" + entityId;
//	}
	
	@Override
	public long getId() {
		return id;
	}
	@Override
	public String getHashableId() {
		return name;
	}
	
	@Override
	public EntityType getUMLType() {
		return EntityType.SECCP;
	}
}

